From ba07c577c626791368d89076781ad94954ca88a0 Mon Sep 17 00:00:00 2001 From: "vhanquez@kneesa.uk.xensource.com" Date: Wed, 15 Mar 2006 11:09:45 +0000 Subject: [PATCH] Do not BUG when receiving unexpected message type from xenbus print a warning and discard the query Signed-off-by: Vincent Hanquez --- linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c index ad43b0ca35..a388a84ffc 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c @@ -237,7 +237,14 @@ static void *xs_talkv(xenbus_transaction_t t, return ERR_PTR(-err); } - BUG_ON(msg.type != type); + if (msg.type != type) { + if (printk_ratelimit()) + printk(KERN_WARNING + "XENBUS unexpected type [%d], expected [%d]\n", + msg.type, type); + kfree(ret); + return ERR_PTR(-EINVAL); + } return ret; } -- 2.30.2